package com.wang.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class M1 {

    @RequestMapping("/m1")
    public String test1(Model model){

        model.addAttribute("msg","wwwwww");

        //这个就相当于请求转发
        return "hello";
    }


    @RequestMapping("/m2")
    public String test2(Model model){

        model.addAttribute("msg","wwwwww");
        //这个是重定向,要加上redirect:  后面就是路径
        return "redirect:/index.jsp";
    }
}
